<template>
    <!-- 推荐区域 -->
    <!-- 商店推荐区域 -->
    <div class="book-main-rec clearfix">
        <h3 class="rec-main-header">
          <span class="bmh-title">好书推荐</span>
        </h3>
        <div class="rec-main-body">
    <div class="book-main-body clearfix">
      <div class="book-main-list w">
        <div class="book_list"  v-for="item in goodsLists" :key="item.id">
          <div class="book_list_top">
            <a href="book_detail.html" target="_blank"
              ><span
                ><img
                  :src="item.img"
                  alt="图片未加载"
                  class="goods"
              /></span>
              <h4>
                {{item.title}}
              </h4></a
            >
          </div>
          <div class="book_list_bottom">
            <div class="price">
              <div class="price_unit">¥</div>
              <div class="price_value">{{item.price}}</div>
              <div class="business">出自于{{item.author}}</div>
              <img src="@/assets/images/love.png" class="love" title="收藏" />
            </div>
          </div>
        </div>
      </div>
    </div>
                  <!-- 底部区域 -->
    <div class="footer clearfix">
      <ul class="f-main w">
        <li>
          <div class="f-top">二手书吧</div>
          <div class="card"><a href="#">关于我们</a></div>
          <div class="card"><a href="#">关于我们</a></div>
          <div class="card"><a href="#">关于我们</a></div>
          <div class="card"><a href="#">关于我们</a></div>
          <div class="card"><a href="#">关于我们</a></div>
          <div class="card"><a href="#">关于我们</a></div>
        </li>
        <li>
          <div class="f-top">我是中间</div>
          <div class="card"><a href="#">帮助中心</a></div>
          <div class="card"><a href="#">帮助中心</a></div>
          <div class="card"><a href="#">帮助中心</a></div>
          <div class="card"><a href="#">帮助中心</a></div>
          <div class="card"><a href="#">帮助中心</a></div>
          <div class="card"><a href="#">帮助中心</a></div>
        </li>
        <li>
          <div class="f-top">我是右侧</div>
          <div class="card"><a href="#">客服中心</a></div>
          <div class="card"><a href="#">客服中心</a></div>
          <div class="card"><a href="#">客服中心</a></div>
          <div class="card"><a href="#">客服中心</a></div>
          <div class="card"><a href="#">客服中心</a></div>
          <div class="card"><a href="#">客服中心</a></div>
        </li>
      </ul>
    </div>
  </div>
  </div>
</template>

<script>
import { mapState } from 'vuex'
export default {
  name: 'RecommendGoods',
  data () {
    return {
      goodsList: [
        {
          id: 1,
          img: require('@/assets/upload/1.jpg'),
          title:
            '中文打字机：一个世纪的汉字突围史',
          price: 20,
          author: '木马'
        },
        {
          id: 2,
          img: require('@/assets/upload/2.jpg'),
          title:
            '周敬青签名+铃印+日期《解读林彪》(16开精装) 国内第一部林彪问题研究专著15年倾力打造',
          price: 99,
          author: '木马'
        }
      ]
    }
  },
  computed: {
    ...mapState(['goodsLists'])
  }
}
</script>

<style scoped>
/* 清除浮动 */
.clearfix:after{
  content: "";
  display: block;
  height: 0;
  clear: both;
  visibility: hidden;
}

/* .clearfix {
  IE6、7 专有
  *zoom: 1;
} */
.book-main-rec {
  position: relative;
  width: 1100px;
  margin: 0 auto;
  background-color: white;
  border-radius: 20px 20px 0 0;
}

.rec-main-header {
  display: block;
  /* padding-top: 25px; */
  height: 70px;
  line-height: 70px;
  background-color: white;
  /* border-bottom: 1px solid #a19a9a; */
  border-bottom: 2px solid #f5f5f5;
  /* padding: 25px 10px 0px 10px; */
  border-radius: 20px 20px 0 0;
}

.bmh-title {
  float: left;
  /* display: block; */
  width: 120px;
  height: 45px;
  border: 1px solid gray;
  /* border-style: dotted; */
  margin-top: 18px;
  margin-left: 20px;
  border-radius: 45px;
  text-align: center;
  color: #111;
  font-weight: bold;
  font-size: 24px;
  line-height: 45px;
  box-shadow: 2px 2px 5px rgb(0 0 0 / 20%);
}

.rec-main-body {
  display: block;
  /* display: none; */
  /* padding-top: 25px; */
  background-color: white;
}

.rec-main-header {
  display: block;
  /* padding-top: 25px; */
  height: 70px;
  line-height: 70px;
  background-color: white;
  /* border-bottom: 1px solid #a19a9a; */
  border-bottom: 2px solid #f5f5f5;
  /* padding: 25px 10px 0px 10px; */
  border-radius: 20px 20px 0 0;
}

.book-main-body {
  display: block;
  /* display: none; */
  /* padding-top: 25px; */
  background-color: white;
}

.book-main-list {
  /* position: relative; */
  margin: 0 auto;
}

/* .bmh-title {
  float: left;
  width: 120px;
  height: 45px;
  border: 1px solid gray;
  margin-top: 20px;
  margin-left: 20px;
  border-radius: 45px;
  text-align: center;
  color: #111;
  font-weight: bold;
  font-size: 24px;
  line-height: 45px;
  box-shadow: 2px 2px 5px rgb(0 0 0 / 20%);
} */

.book_list {
  /* position: absolute; */
  width: 245px;
  height: 340px;
  background: #fff;
  margin-left: 14px;
  margin-top: 24px;
  /* margin-bottom: 50px; */
  float: left;
  border-radius: 10px;
  box-shadow: 1px 2px 3px rgb(0 0 0 / 10%);
  cursor: pointer;
  overflow: hidden;
  box-sizing: border-box;
}

.book_list a {
  color: black;
  text-decoration: none;
}

.book_list_top {
  width: 245px;
  overflow: hidden;
  height: 275px;
}

.book_list img {
  width: 100%;
  height: 220px;
  overflow: hidden;
  box-sizing: border-box;
}

.book_list:hover {
  /* box-shadow: 2px 4px 8px rgb(0 0 0 / 10%); */
  border: 2px solid #f5f5f5;
  box-shadow: 5px 8px 8px rgb(0 0 0 / 10%);
}

/* .book_list:hover .goods {
  transform: translateY(-6px);
} */

.book_list h4 {
  height: 38px;
  width: 230px;
  color: #222;
  font: 15px/1.25 Microsoft Yahei, Hiragino Sans GB, Heiti SC,
    WenQuanYi Micro Hei, sans-serif !important;
  font-weight: 400;
  /* line-height: 20px; */
  margin: 5px auto;
  margin-bottom: 8px;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.book_list_bottom {
  width: 245px;
  height: 60px;
  margin-top: 5px;
}

.book-main-body .price {
  height: 60px;
  padding-left: 8px;
  font-weight: 400;
  text-align: center;
  line-height: 65px;
  vertical-align: middle;
}

.price .price_unit {
  font-size: 20px;
  color: #fd3f31;
  float: left;
  padding-top: 15px;
  margin: 0 5px 0 6px;
  line-height: 22px;
}

.price .price_value {
  font-size: 35px;
  line-height: 22px;
  color: #fd3f31;
  padding-top: 10px;
  float: left;
}

.price .business {
  font-size: 10px;
  color: rgb(153, 153, 153);
  float: left;
  width: 90px;
  height: 54px;
  /* background-color: pink; */
  margin-left: 20px;
  line-height: 54px;
  box-sizing: border-box;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.price .love {
  float: left;
  width: 25px;
  height: 25px;
  margin: 10px 0 0 15px;
}

.price .love:hover {
  transform: translateY(-1px);
}
/* 首页底部区域 */
.footer {
  background-color: #fff;
  margin: 60px auto;
}

.footer a {
  text-decoration: none;
  color: #797979;
}

.footer .f-main {
  display: block;
  height: 150px;
  border-top: 1px solid rgb(229, 233, 239);
  border-bottom: 1px solid rgb(229, 233, 239);
  margin: 10px auto;
}

.footer .f-top {
  width: 200px;
  height: 30px;
  /* text-align: center; */
  line-height: 30px;
  font-size: 12px;
  color: rgb(153, 162, 177);
  margin-bottom: 5px;
}

.footer ul li {
  float: left;
  text-align: left;
  list-style: none;
  width: 340px;
  height: 112px;
  padding-left: 20px;
  line-height: 1;
  border-left: 1px solid #e5e9ef;
  font-size: 14px;
  margin: 5px 0 0 0;
}

.footer a:hover {
  color: skyblue;
}

.footer .card {
  float: left;
  width: 120px;
  margin-bottom: 16px;
}
</style>
